# datastore.py - google datastore schema for 'webtrees69'

from google.appengine.ext import db

# Datastore models

class Webtree(db.Model):
    name = db.StringProperty()  # the name of the webtree
    contents = db.TextProperty() # either json or xml ( if first non-space char is '<' then its xml :P )
    owner = db.UserProperty()  # the owner

    public = db.BooleanProperty(default=False) # if True, then it's public to all members
    anonymous = db.BooleanProperty(default=False) # if True, then it's public even to anonymous websurfers

    modified = db.DateTimeProperty(auto_now=True)
    modified_by = db.UserProperty(auto_current_user=True)
    created = db.DateTimeProperty(auto_now_add=True)
    created_by = db.UserProperty(auto_current_user_add=True)

